package com.kata.chapter7;

/**
 * Created by tzhang on 11/21/2014.
 */
public class ArmsDealersProxy implements IArmsDealers {

    IArmsDealers target;

    private void box() {
        System.out.println("包装武器");
    }

    private void flowToCustom() {
        System.out.println("将包裹寄给客户");
    }


    public ArmsDealersProxy(IArmsDealers target) {
        this.target = target;
    }

    public ArmsDealersProxy() {
        this.target = new DMZ();
    }

    @Override
    public String buyPistol() {
        this.box();
        this.flowToCustom();
        return this.target.buyPistol();
    }

    @Override
    public String buyRifle() {
        this.box();
        this.flowToCustom();
        return this.target.buyRifle();
    }
}
